<script setup>
import {onMounted, ref} from 'vue'
import {ElMessage} from "element-plus";
import axios from "axios";

const arr = ref({})
onMounted(() => {
  const urlParams = new URLSearchParams(window.location.search);
  const id = urlParams.get('id');
  if (id != null) {
    axios.get(BASE_URL + "/v1/department/"+id+"/select").then((response) => {
      if (response.data.code === 20000) {
        arr.value = response.data.data;
      } else ElMessage.error(response.data.message)
    })
  }
})
</script>

<template>
<el-card style="width: 1200px;margin: 0 auto">
  <el-row>
      <el-col :span="12">
        <img :src="BASE_URL+arr.imgUrl" alt="" width="550">
      </el-col>
      <el-col :span="12">
        <el-row>
          <el-col :span="4"><div class="divII">科室编号：</div></el-col>
          <el-col :span="20"><div class="divI">{{arr.number}}</div></el-col>
        </el-row>
        <el-row>
          <el-col :span="4"><div class="divII">科室名称：</div></el-col>
          <el-col :span="20"><div class="divI">{{arr.name}}</div></el-col>
        </el-row>
        <el-row>
          <el-col :span="4"><div class="divII">描述说明：</div></el-col>
          <el-col :span="20"><div class="divI">{{arr.content}}</div></el-col>
        </el-row>
      </el-col>
  </el-row>
</el-card>
</template>

<style scoped>
.divI{
  text-align: left;
  line-height: 23px;
}
.divII{
  font-weight: bold;
  float: right
}
</style>